package com.topcheer.common.base.util;

import org.springframework.util.AntPathMatcher;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Stream;

/**
 * @author xutao
 * @Package com.topcheer.common.base.util
 * @Description: ${todo}
 * @date 2020/4/1 18:49
 */
public class SimpleAntPathMatcher extends AntPathMatcher {

    public boolean match(String[] patterns, String path, String contextPath) {
        return Arrays.stream(patterns).filter(pattern -> {
            return super.match(contextPath + pattern, path);
        }).count() > 0;
    }
}
